package com.czbank.financing.mapper;

import com.czbank.financing.Entity.Product;
import com.czbank.financing.Entity.UserInfo;
import org.apache.ibatis.annotations.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Auther: thinkpad
 * @Date: 2019/7/12 18:01
 * @Description:
 */
@Resource(name="userInfoMapper")
public interface UserInfoMapper {
    @Select("SELECT * FROM user_info where username = #{username}")
    public UserInfo findAllUserInfo(@Param("username") String username);

    @Select("SELECT * FROM user_info where username = #{username}")
    public List<UserInfo> QueryOneUserInfo(@Param("username") String username);

    @Select("SELECT * FROM user_info")
    public List<UserInfo>  AllUserInfo();

    @Select("SELECT * FROM user_info where id = #{id}")
    public UserInfo findByIdUserInfo(@Param("id") int id);

    @Update("Update user_info set password = #{password} where id =#{id}")
    public int UpdateUserInfo(@Param("id") int id,@Param("password") String password);

    @Insert("insert into user_info (account,username,password) values(#{account},#{username},#{password})")
    public int InsertUserInfo(@Param("account") String account,@Param("username") String username,@Param("password") String password);

    @Delete("delete from user_info where id=#{id}")
    public int DeleteUserInfo(@Param("id") int id);
}
